package com.huyirong.aicode.service;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.RandomUtil;
import com.huyirong.aicode.constant.AppConstant;
import com.huyirong.aicode.exception.BusinessException;
import com.huyirong.aicode.exception.ErrorCode;
import com.huyirong.aicode.exception.ThrowUtils;
import com.huyirong.aicode.model.dto.app.AppAddRequest;
import com.huyirong.aicode.model.dto.app.AppQueryRequest;
import com.huyirong.aicode.model.entity.App;
import com.huyirong.aicode.model.entity.User;
import com.huyirong.aicode.model.vo.AppVo;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import reactor.core.publisher.Flux;

import java.io.File;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 应用 服务层。
 *
 * @author 小组成员:胡意蓉、陈炜洁、杨豪喻、张晓凤、晏俭涛
 */
public interface AppService extends IService<App> {
     AppVo getAppVo(App app);

     QueryWrapper getQueryWrapper(AppQueryRequest appQueryRequest);

    /**
     * 获取应用列表
     * @param appList
     * @return
     */
     List<AppVo> getAppVOList(List<App> appList);

     Flux<String> chatToGenCode(Long appId, String message, User loginUser);

     String deployApp(Long appId, User loginUser);

     boolean removeById(Serializable id);

     void generateAppScreenshotAsync(Long appId, String appUrl);

     Long createApp(AppAddRequest appAddRequest, User loginUser);
}

